package net.zoneland.zrdp.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 业务异常
 *
 * @author zonevue
 */

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public final class ServiceException extends RuntimeException
{
    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误提示
     */
    private final String message;

    /**
     * 错误明细，内部调试错误
     *
     */
    private String detailMessage;



    public ServiceException(final String message) {
        super(message);
        this.message = message;
    }

    public ServiceException(final String message, final Throwable throwable) {
        super(message, throwable);
        this.message = message;
    }

    public ServiceException(final String message, final Integer code, final Throwable throwable) {
        super(message, throwable);
        this.message = message;
        this.code = code;
    }
}
